home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / filutil / dfmake.zip / DFMAKE.DOC next >
Text File  |  1994-08-01  |  9KB  |  238 lines

  1.  
  2.                     ┌───────────────────────────────────┐
  3.                     │            DFMAKE v1.0            │
  4.                     ├───────────────────────────────────┤
  5.                     │  (c) 1994 by DIGITAL UNDERGROUND  │
  6.                     │Programmed by Alessandro 'BLOB' Job│
  7.                     └───────────────────────────────────┘
  8.  
  9. ┌──────────────┬────────────────────────────────────────────────────────────
  10. │ Introduction │
  11. └──────────────┘
  12.  
  13.     DFMAKE is a small utility for joining a number of files in a unique
  14.     BIG file,and giving access to each of the old little files contained
  15.     in it.
  16.     This is PUBLIC DOMAIN.
  17.  
  18. ┌────────────┬──────────────────────────────────────────────────────────────
  19. │ Disclaimer │
  20. └────────────┘
  21.  
  22.     DIGITAL UNDERGROUND & Alessandro Job makes no warranty of any kind,
  23.     either express or implied,including but not limited to implied
  24.     warranties of merchantability and fitness for a particular purpose,
  25.     with respect to this software and accompanying documentation.
  26.  
  27.     IN NO EVENT SHALL DIGITAL UNDERGROUND & Alessandro Job BE LIABLE FOR
  28.     ANY DAMAGES RESULTING FROM THE USE OF THIS SOFTWARE, INCLUDING BUT NOT
  29.     LIMITED TO, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
  30.     LOSS OF BUSINESS INFORMATION, INCIDENTAL OR CONSEQUENTIAL DAMAGES, OR
  31.     OTHER FINANCIAL LOSS ARISING OUT OF THE USE OF OR INABILITY TO USE THIS
  32.     PROGRAM , EVEN IF DIGITAL UNDERGROUN & Alessandro Job HAS BEEN ADVISED
  33.     OF THE POSSIBILITY OF SUCH DAMAGES.
  34.  
  35. ┌───────┬───────────────────────────────────────────────────────────────────
  36. │ Usage │
  37. └───────┘
  38.  
  39.     DFMAKE builds a datafile library from a list of files you pass to it
  40.     with the -fFILELIST command line option (where FILELIST is the name of
  41.     the text file where your files ar listed).
  42.     The name of the datafile library must be the first argument of DFMAKE.
  43.     The format of the text file is very simple: you need only to write the
  44.     name of the files divided by a CR,a space or a comma.If the files you
  45.     need are not in the current dir,you must specify them with the full
  46.     path name.
  47.     Filenames in library are case sensitive.
  48.  
  49.     Usage: DFMAKE [library name] [-command[commandoption]]
  50.  
  51.     This are the commands you can use:
  52.  
  53.         -?,-h       : show the help.
  54.  
  55.         -fFILELIST  : this is the text file with the list of files you have
  56.                       to insert in the new library file.
  57.                       Use this option only when you want to create a library
  58.                       file from scratch.
  59.  
  60.         -aFILENAME  : add file FILENAME to the top of the library.If the
  61.                       file is not in the current dir give full pathname.
  62.  
  63.         -dFILENAME  : delete file FILENAME from the library.
  64.  
  65.         -xFILENAME  : extract file FILENAME from the library to the current
  66.                       dir.If FILENAME = *,extract all files in library.
  67.  
  68.         -rOLDFILENAME NEWFILENAME   : rename the file OLDFILENAME,contained
  69.                                       in the library,in NEWFILENAME.
  70.  
  71. ┌──────────────┬────────────────────────────────────────────────────────────
  72. │ Developement │
  73. └──────────────┘
  74.  
  75.     Some routines to access a datafile library are supplyed.They are not
  76.     very optimized,but they are only examples.All the functions use the
  77.     PMC library functions for PMODE by Thomas Pytel.
  78.  
  79.     FUNCTIONS SUPPLYED:
  80.  
  81.     Name:
  82.  
  83.         WORD __cdecl df_open(STR filename);
  84.  
  85.         Usage:
  86.             opens the 'filename' datafile library.
  87.  
  88.             In: filename    =   full name of the datafile.
  89.             Out:WORD        =   file handle if datafile opened
  90.                                 else NULL.
  91.  
  92.     Name:
  93.  
  94.         void __cdecl df_close(WORD df_handle);
  95.  
  96.         Usage:
  97.             closes a previously opened datafile.
  98.  
  99.             In: df_handle   =   datafile file handle.
  100.  
  101.     Name:
  102.  
  103.         DATAFILE * __cdecl df_getinfos(WORD df_handle);
  104.  
  105.         Usage:
  106.             get all the infos to access the files in the datafile.
  107.  
  108.             In: df_handle   =   file handle returned by df_open();
  109.             Out:DATAFILE *  =   a pointer to a list of DATAFILE structs
  110.                                 containing all the infos.
  111.                                 NULL if an error occurred.
  112.  
  113.     Name:
  114.  
  115.         void __cdecl df_delinfos(DATAFILE *datafileinfo);
  116.  
  117.         Usage:
  118.             frees the memory allocated by df_getinfos().Use this function
  119.             only when you want to have no more access to the datafile.
  120.  
  121.             In: datafileinfo=   a pointer to the list of DATAFILE structs
  122.                                 returned by df_getinfos().
  123.  
  124.     Name:
  125.  
  126.         PTR __cdecl df_read(WORD df_handle,DATAFILE *datafileinfo, \
  127.                             STR name,PTR buffer);
  128.  
  129.         Usage:
  130.             reads in memory a file contained in the datafile.
  131.  
  132.             In: df_handle   =   the file handle of the datafile.
  133.                 datafileinfo=   the pointer returned by df_getinfos().
  134.                 name        =   the name of the file to be loaded.
  135.                 buffer      =   a pointer to a pre-allocated buffer of the
  136.                                 size of the file to be loaded,or NULL if
  137.                                 allocation must be done by function.
  138.             Out:PTR         =   the pointer to the memory containing the
  139.                                 loaded file,or NULL if error.
  140.  
  141.     DATA STRUCTURES:
  142.  
  143.         struct datafile {
  144.             BYTE    name[13];       // name of the file
  145.             DWORD   offset;         // positive offset from the file's end
  146.             DWORD   length;         // lenght in bytes of the file
  147.             struct datafile *next;  // next file info structure or NULL
  148.         };
  149.  
  150.         typedef struct datafile DATAFILE;
  151.  
  152.         This is the structure used to store the infos for every file in
  153.         the datafile.
  154.  
  155. ┌─────────────────────────┬─────────────────────────────────────────────────
  156. │ DATAFILE library format │
  157. └─────────────────────────┘
  158.  
  159.     This is the format of a datafile file made by DFMAKE.
  160.     All offsets are positive offsets from the end of the datafile.
  161.  
  162.     File START->┌───────────────────────┐
  163.                 │ First file            │
  164.                 │ ...                   │
  165.                 │ ...                   │
  166.                 ├───────────────────────┤
  167.                 │ Second file           │
  168.                 │ ...                   │
  169.                 │ ...                   │
  170.                 ├───────────────────────┤
  171.                 │ ...                   │
  172.                 │ ...                   │
  173.                 │ ...                   │
  174.                 ├───────────────────────┤
  175.                 │ Nth file              │
  176.                 │ ...                   │
  177.                 │ ...                   │
  178.                 ├───────────────────────┤
  179.     NFILES----->│ 2 BYTES               │
  180.                 │ Number of files in lib│
  181.                 ├───────────────────────┤
  182.                 │ 21 BYTES              │
  183.                 │ First file header     │
  184.                 │                       │
  185.                 │ 13 BYTES: file name   │
  186.                 │ 4 BYTES:  offset from │
  187.                 │           end of file │
  188.                 │ 4 BYTES:  file lenght │
  189.                 ├───────────────────────┤
  190.                 │ Second file header    │
  191.                 │ ...                   │
  192.                 │ ...                   │
  193.                 ├───────────────────────┤
  194.                 │ Nth file header       │
  195.                 │ ...                   │
  196.                 │ ...                   │
  197.                 ├───────────────────────┤
  198.                 │ 4 BYTES               │
  199.                 │ NFILES offset from end│
  200.                 │ of file               │
  201.                 ├───────────────────────┤
  202.                 │ 4 BYTES               │
  203.                 │ "DATA" signature      │
  204.     File END--->└───────────────────────┘
  205.  
  206. ┌──────────────────┬────────────────────────────────────────────────────────
  207. │ Acknowledgements │
  208. └──────────────────┘
  209.  
  210.     This piece of code uses the great PMODE handler and PMC interface and
  211.     library by Thomas 'TRAN' Pytel.
  212.     I want to thank him for this fantastic stuff. Thank you.
  213.  
  214. ┌───────────┬───────────────────────────────────────────────────────────────
  215. │ Greetings │
  216. └───────────┘
  217.  
  218.     Greetings to all the demo-coders,utility-coders & coders all around
  219.     the globe.
  220.  
  221. ┌───────┬───────────────────────────────────────────────────────────────────
  222. │ INFOS │
  223. └───────┘
  224.  
  225.     This code is PUBLIC DOMAIN,but if you find it usefull and you use it
  226.     in some productions,please,credit me.(This is CREDIT-WARE !! 8-} )
  227.     You can also contact me if you have suggestions,comments,flames,etc.
  228.     at this addresses:
  229.  
  230.     Internet:       S0IOB@uduniv.cc.uniud.it (i'm not here very otfen)
  231.  
  232.     S-MAIL:              Alessandro Job
  233.                         via Peresson ,12
  234.                     33020 - Piano d'Arta (UD)
  235.                              ITALY
  236.  
  237.  
  238.